<script setup>
import { ref, onMounted } from 'vue';
import { ElButton } from 'element-plus';

const counter = ref(0);

const increase = () => counter.value++;

// 注册生命周期钩子
onMounted( () => {
  console.log( 'counter:', counter ); 
  console.log( 'increase:', increase ); 
});
</script>

<template>
  <div>
    <p>使用&lt;script setup&gt;</p>
    <el-button type="primary" @click="increase">{{counter}}</el-button>
  </div>
</template>
